package ModelLayer;


/**
 * A partorder class makes it posible to order more than one kind of product in each order. 
 * 
 * @author  Team Black
 * @version 1.0
 */
public class PartOrdre
{
    static int runningPartOrderNumber;
    private int id;
    //private long partOrdre;
    private long discount;
    private Product product;
    private double price;
    
    public PartOrdre()
    {
        runningPartOrderNumber++;
        id = runningPartOrderNumber;
        //partOrdre = 0;
    }
   /**
     * mutator and accessor for the fields; ID, Discount and product.
     */
    public int getNumber()
    {
        return id;
    }
    public void setDiscount(long _discount)
    {
        discount = _discount;
    }
    public long getDiscount()
    {
        return discount;
    }
    //     
    //     public void setPartOrdre(long _partOrdre)
    //     {
    //         partOrdre = _partOrdre;
    //     }
    //     
    //     public long getPartOrdre()
    //     {
    //         return partOrdre;
    //     }
    
    public void setProduct(Product _product)
    {
        product = _product;
    }
    
    public Product getProduct()
    {
        return product;
    }
    public double getPrice()
    {
        price = product.getPrice() - getDiscount();
        return price;
    }

    
    

}
